package com.isoft.c2team3service2.service.impl;

import com.isoft.c2team3service2.entity.Person;
import com.isoft.c2team3service2.mapper.PersonMapper;
import com.isoft.c2team3service2.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PersonServiceImpl implements PersonService {
   @Autowired
   PersonMapper personMapper;

    @Override
    public boolean insertPerson(String username,String birthdate,
                                String phonenumber,String nick_name ,
                                String  email ,Integer  login_id) {
       return personMapper.insertPerson(username,birthdate,phonenumber,nick_name,email,login_id) > 0;
    }

    @Override
    public Person updatePerson(String email) {
        if(email==null){
            return null;
        }
       return personMapper.updatePerson(email);
    }

    @Override
    public Person selectById(Integer id) {
        return personMapper.selectById( id);
    }
}
